import React from 'react'
// 引入图标库
import { Sticky } from 'react-vant'
import { MyIcon } from '../MyIcon/MyIcon'
import { useNavigate } from 'react-router-dom'
export default function Head(props) {
    const navigate = useNavigate()
    return (
        <Sticky>
            <div style={{ display: 'flex', width: '100%', height: '50px', alignItems: 'center', position: 'relative',backgroundColor:'white' }}>
                <MyIcon onClick={() => { window.history.back();if(props.socket){props.socket.disconnect() }}} style={{ fontSize: '40px', position: 'absolute' }} type='icon-fanhui'></MyIcon>
                <div style={{ textAlign: 'center', width: '100%', fontWeight: '500', fontSize: '22px' }}>{props.titleName}</div>
            </div>
        </Sticky>
    )
}
